<?php


/**
 * AppInit component for cheeseCake
 *
 * Creates the config settings in the Session and also creates a list of
 * activated addons in the Session
 *
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License V2
 * @package cheeseCake
 * @version $Id: app_init.php 458 2007-02-05 12:20:47Z tariquesani $
 */
class appInitComponent extends Object
{
  var $components = array (
	'Session'
  );

  function startup(& $controller)
  {
	/**
	 * If the config settings are not in Session put them
	 */
	//loadModel('Config');
	App::import('Model', 'Config');
	$configObject = & new Config;

	  $config = $configObject->find('id=1');

	  foreach ($config['Config'] as $name => $value)
	  {
		$this->Session->write('daoppler.' . $name, $value);
	  }

	  unset ($config);
	  unset ($configObject);


	$controller->theme = $this->Session->read('daoppler.theme');
	//$controller->siteUrl = $this->Session->read('daoppler.siteUrl');
	//$controller->siteName = $this->Session->read('daoppler.siteName');	

  }
}
